using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class MouseCursor : MonoBehaviour {
	
	public enum CursorTypes{
		ACTION = 0,	
	}
	//private Dictionary<string, GameObject> cursorsDictionary;
	private GameObject activeCursor;
	private GameObject[] cursorsGameObject;
	private Vector3 mousePos;
			
	public GameObject[] cursors;
	void Start () {
	/*	cursorsDictionary = new Dictionary<string, GameObject>();
		foreach (GameObject cursor in cursors){
			cursorsDictionary[cursor.name] = cursor;
		}
		activeCursor = cursorsDictionary["actionCursor"];
	*/
		cursorsGameObject = new GameObject[cursors.Length];
		for (int i=0; i<cursors.Length; i++){
			cursorsGameObject[i] = 
				GameObject.Instantiate((Object)cursors[i] ) as GameObject;	
		}
		activeCursor = cursorsGameObject[(int)CursorTypes.ACTION];
		Debug.Log(this.GetComponent<Camera>().GetScreenWidth() );
	}
	
	void Update () {
		if (activeCursor != null){
			mousePos = Vector3.zero;
			mousePos.x = Event.current.mousePosition.x;
			mousePos.y = Event.current.mousePosition.y;
			activeCursor.transform.position = mousePos - 
				(Screen.width/2*Vector3.right + Screen.height/2*Vector3.up);
		}
	}
}
